<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
		<title>登录</title>
		<link rel="icon" type="image/x-icon" href="${app }/static/favicon.ico">
		<link rel="stylesheet" href="${app }/static/layui/css/layui.css" media="all" />
		<link rel="stylesheet" href="${app }/static/css/login/gloab.css" />
		<link rel="stylesheet" href="${app }/static/css/login/login.css" />
	</head>
	<body>
	    <div class="layui-header header login-header">
	        <div class="layui-main login-top-bg">
	            <div class="sitename">
	                <a class="logo" href="${app }/">
	                    <img src="${app }/static/images/login/logo.png" alt="logo" />
	                </a>
	                <h2>瀚丞科技管理系统</h2>
	            </div>
	            <ul class="layui-nav login-top-menu" lay-filter="demo">
	                <li class="layui-nav-item"><a href="">网站导航</a></li>
	                <li class="layui-nav-item"><a href="">使用手册</a></li>
	                <li class="layui-nav-item"><a href="">官方网站</a></li>
	            </ul>
	        </div>
	    </div>
	    <div class="login_content">
	        <div id="regist">
	            <div id="login-banner">
	                <a href="${app }/" target="_blank">
	                    <img src="${app }/static/images/login/mhdcity.jpg" />
	                </a>
	            </div>
	            <div id="login">
	                <form action="${app }/doLogin.do" class="layui-form layui-form-pane" id="sign-in" method="post">
	                    <p>
	                        <div class="layui-form-item">
	                            <label class="layui-form-label">账号</label>
	                            <div class="layui-input-block">
	                                <input name="userName" lay-verify="userName" autocomplete="off" value="admin" placeholder="请输入账号" class="layui-input" type="text" />
	                            </div>
	                        </div>
	                    </p>
	                    <p>
	                        <div class="layui-form-item">
	                            <label class="layui-form-label">密码</label>
	                            <div class="layui-input-block">
	                                <input name="userPwd" lay-verify="userPwd" autocomplete="off" value="123123" placeholder="请输入密码" class="layui-input" type="password" />
	                            </div>
	                        </div>
	                    </p>
	                    <!--
	                    <p>
	                        <div class="layui-form-item">
	                            <label class="layui-form-label">验证码</label>
	                            <div class="layui-input-block">
	                                <input type="text" name="user_code" id="user_code" class="layui-input input" value="" size="4" onpaste="return false" maxlength="4"
										   onfocus=""
										   onkeyup="value=value.replace(/[^\w\.\/]/ig,'')" />
	                                <a class="send" title="点击切换验证码" href="javascript:;" data-url="${app }/randCodeImage">
	                                    <img src="${app }/randCodeImage" width="70" height="30" />
	                                </a>
	                            </div>
	                        </div>
	                    </p>-->
	                    <p>
	                        <div class="layui-form-item" style="text-align: right;">
	                            <div class="layui-input-block">
	                                <input name="rememberMe" title="记住我" type="checkbox" value="true" />
	                            </div>
	                        </div>
	                    </p>
	                    <p>
	                        <div class="layui-form-item">
		                        <button class="layui-btn" lay-submit lay-filter="login" data-loading-text="登录中...">
	                            	<i class="layui-icon">&#xe650;</i> 登　陆
	                        	</button>
	                        </div>
	                    </p>
	                    <p id="nav">忘记密码 or 没有账号？请联系管理修改。</p>
	                </form>
	            </div>
	            <div class="clear"></div>
	        </div>
	    </div>
	    <div class="layui-footer footer footer-doc">
	        <div class="layui-main">

	            <p>copyright &#169; 2017 xzsofts. ALL RIGHTS RESERVED.CMS  技术支持：changs</p>
	            <p>
	                <a id="pay" href="javascript:;">捐赠作者</a>
	                <a id="git" href="javascript:;">Git仓库</a>
	                <a id="weibo" href="javascript:;">微博</a>
	                <a id="weixin" href="javascript:;">微信公众号</a>
	            </p>
	        </div>
	    </div>
	    <div class="shang_box" style="display: none;">
	        <div class="shang_tit">
	            <p>感谢您的支持，我会继续努力的!</p>
	        </div>
	        <div class="shang_payimg">
	            <img src="${app }/static/images/alipayimg.png" alt="扫码支持" title="扫一扫" />
	        </div>
	        <div class="pay_explain">扫码打赏，你说多少就多少</div>
	        <div class="shang_info">
	            <p>打开<span id="shang_pay_txt">支付宝</span>扫一扫，即可进行扫码打赏哦</p>
	        </div>
	    </div>
	</body>
    <script type="text/javascript" src="${app }/static/layui/layui.js"></script>
    <script type="text/javascript">
		//Layui 扩展组件入口
		layui.config({
			base: '${app }/static/layui/modules/' //自定义layui组件的目录
		}).extend({//设定组件别名
			common: 'common'
		});
        layui.use(['layer', 'form', 'element', 'common'], function () {
            var $ = layui.jquery,
            	layer = layui.layer,
            	form = layui.form(),
				device = layui.device(),
				common = layui.common,
            	element = layui.element();//导航的hover效果、二级菜单等功能，需要依赖element模块

			if (device.ie && device.ie < 9) {
				layer.alert('最低支持ie9，您当前使用的是古老的 IE' + device.ie + '！');
			}

			form.verify({
				userName: function(value){
					if(!new RegExp("^[a-zA-Z0-9_\u4e00-\u9fa5\\s·]+$").test(value)){
						return '用户名不能有特殊字符';
					}
					if(/(^\_)|(\__)|(\_+$)/.test(value)){
						return '用户名首尾不能出现下划线\'_\'';
					}
					if(/^\d+\d+\d$/.test(value)){
						return '用户名不能全为数字';
					}
				},

				//我们既支持上述函数式的方式，也支持下述数组的形式
				//数组的两个值分别代表：[正则匹配、匹配不符时的提示文字]
				userPwd: [
					/^[\S]{6,12}$/,
					'密码必须6到12位，且不能出现空格'
				]
			});

			//捐赠
		    $('#pay').on('click', function () {
		        layer.open({
		            type: 1,
		            title: false,
		            area: ['562px', '450px'],
		            content: $('.shang_box')
		        });
		    });
            	
		    var result='${loginRes}';
			if(result!='' && result==0){
				common.layerAlertE('用户名或密码错误!', '登录失败');
			} else if(result!='' && result==-1){
				common.layerAlertE('登录错误次数过多!', '登录失败');
			} else if(result!='' && result==-2){
				common.layerAlertE('用户被锁定!', '登录失败');
			}
		    
			//监听导航点击
			element.on('nav(demo)', function(elem){
				layer.msg(elem.text());
			});
			
			$('#git,#weibo,#weixin').on('click', function () {
		        layer.tips('暂时没有哦!', this)
		    });
        });
    </script>
</html>